package TEST2;


    import java.util.Scanner;

    public class TestVehicle {
        public static void main(String[]args) {
 Scanner sc=new Scanner(System.in);

 int sp=sc.nextInt();

 int si=sc.nextInt();

 Vehicle car=new Vehicle();

 car.setSpeed(sp);

            car.setSize(si);

            car.printvehicle();

            System.out.print("汽车的速度增加了：");

            int up=sc.nextInt();

            car.speedUp(car,up);

            System.out.print("汽车的速度减少了：");

            int down=sc.nextInt();

         car.speedDown(car,down);

        }

    }

public class Vehicle {
        int speed;

        int size;

        int up;

        int down;

        void move() {



        }

         void setSpeed(int sp ) {

         speed=sp;

        }

        void setSize(int si) {

        size=si;

        }

        void printvehicle() {

        System.out.println("汽车的速度为"+speed+"千米/时");

        System.out.println("汽车的体积为"+size+"立方米");

        }

        void speedUp(Vehiclecarr,int upp) {

        up=carr.speed+upp;

        System.out.println("汽车加速后的速度为："+up+"千米/时");

        }

        void speedDown(Vehiclecarr,int downn) {

        down=carr.speed-downn;

        System.out.println("汽车减速后的速度为："+down+"千米/时");

        }

        }

